package demo2;

import java.util.ArrayList;
import java.util.Iterator;

public class test3 {
    public static void main(String[] args) {
        ArrayList<String> arrayList = new ArrayList<>();
        arrayList.add("abc");
        arrayList.add("efg");
        arrayList.add("kjl");
        arrayList.add("mmm");

        Iterator<String> it = arrayList.listIterator();
        while(it.hasNext()){
            System.out.println(it.next()+" ");
        }
        System.out.println();
    }
}
